package reflect;

@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 22;
    
    public Person(){

    }

    public Person(String name){
        this.name = name;
    }
    
    public Person(String name,int age){
        this.name=name;
        this.age = age;
    }

    private void hehe(){
        System.out.println("哈哈哈哈哈");
    }
    @AutoRun(value=5,num=2)
    public void sayHello(){
        System.out.println("Person:Hello!");
    }
    
    public void sayGoodBye(){
        System.out.println("Person:看电视");
    }

    @AutoRun(value=5,num=2)
    public void watchTV(){
        System.out.println("Person:看电视");
    }

    public void say(String info){
        System.out.println(name+"说："+info);
    }
    public void say(String info,int count){
        for (int i = 0; i < count; i++) {
            System.out.println(name+"说："+info);
        }
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
